from sqlalchemy import Column, String, Text, text,SmallInteger,Integer
from app.db.base_class import Base
__all__ = [
    'OfficialReply', 'official_reply'
]


class OfficialReply(Base):
    """公众号回复实体"""
    __tablename__ = 'la_official_reply'
    __table_args__ = { 'comment': '公众号的回复表',}

    name = Column(String(64), nullable=False, default='', comment='规则名')
    keyword = Column(String(64), nullable=False, default='', comment='关键词')
    reply_type = Column(SmallInteger, nullable=False, server_default=text('0'), comment='回复类型: [1=关注回复 2=关键字回复, 3=默认回复]')
    matching_type = Column(SmallInteger, nullable=False, server_default=text('1'),comment='匹配方式: [1=全匹配, 2=模糊匹配]')
    content_type = Column(SmallInteger, nullable=False, server_default=text('1'), comment='内容类型: [1=文本]')
    status = Column(SmallInteger, nullable=False, server_default=text('0'),comment='启动状态: [1=启动, 0=关闭]')
    content = Column(Text, nullable=False, comment='回复内容')
    sort = Column(Integer, nullable=False, server_default=text('50'), comment='排序编号')

official_reply = OfficialReply.__table__
